package demo2;

public class BankPay implements Pay{
    double m=200;

    @Override
    public void pay(double money) {
        if(m<money){
            System.out.println("余额不足");
        }else{
            System.out.println("消费了"+money);
            m=m-money;
            System.out.println("卡内余额为"+m);
        }
    }
}
